import com.czmh.etc.onlinepubsys.OnlinepubsysApplication;
import com.czmh.etc.onlinepubsys.entity.mingchuang.Device;
import com.czmh.etc.onlinepubsys.services.mingchuang.IDeviceService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = OnlinepubsysApplication.class)
public class App {
    
    @Autowired
    private IDeviceService deviceService;

    @Test
    public void saveOrUpdate() {
        Device entity = new Device(null, "设备3", 72000, null);
        deviceService.saveOrUpdate(entity);
    }

    @Test
    public void list() {
        deviceService.list().forEach(System.out::println);
    }

    @Test
    public void get() {
        Device device = deviceService.get("1269951368334573570");
        System.out.println(device);
    }
}
